{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "07a01d38-bfea-453c-9040-72f6cc872bf3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Working on a Windows 10\n",
"Python version 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)]\n",
"Pandas version 1.5.3\n",
"bifacial_radiance version 0.4.4.dev25+g9486645.d20240925\n"
]
}
],
"source": [
"# This information helps with debugging and getting support :)\n",
"import sys, platform\n",
"import pandas as pd\n",
"import bifacial_radiance as br\n",
"print(\"Working on a \", platform.system(), platform.release())\n",
"print(\"Python version \", sys.version)\n",
"print(\"Pandas version \", pd.__version__)\n",
"print(\"bifacial_radiance version \", br.__version__)"
]
},
{
"cell_type": "markdown",
"id": "a54352a3",
"metadata": {},
"source": [
"# 21 - Weather to Module Performance\n",
"## Modeling Performance, an End to End Simulation\n",
"\n",
"This tutorial shows how to use the new function on bifacial_radiance calculatePerformanceModule performance, as well as how to find CEC Module parameters.\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "23074a65",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Your simulation will be stored in C:\\Users\\cdeline\\Documents\\Python Scripts\\Bifacial_Radiance\\bifacial_radiance\\TEMP\\Tutorial_21\n"
]
}
],
"source": [
"import os\n",
"from pathlib import Path\n",
"\n",
"testfolder = str(Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'Tutorial_21')\n",
"\n",
"if not os.path.exists(testfolder): os.mkdir(testfolder)\n",
"\n",
"# Another option using relative address; for some operative systems you might need '/' instead of '\\'\n",
"# testfolder = os.path.abspath(r'..\\..\\bifacial_radiance\\TEMP') \n",
"\n",
"print (\"Your simulation will be stored in %s\" % testfolder)\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "51fe7bf3",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'0.4.4.dev25+g9486645.d20240925'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import bifacial_radiance\n",
"import numpy as np\n",
"import pandas as pd\n",
"import pvlib \n",
"\n",
"bifacial_radiance.__version__"
]
},
{
"cell_type": "markdown",
"id": "2469642f",
"metadata": {},
"source": [
"## Geting a CEC Module to pass into demo.makeModule"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "1423a9f2",
"metadata": {},
"outputs": [],
"source": [
"url = 'https://raw.githubusercontent.com/NatLabRockies/SAM/patch/deploy/libraries/CEC%20Modules.csv'\n",
"db = pd.read_csv(url, index_col=0) # Reading this might take 1 min or so, the database is big."
]
},
{
"cell_type": "markdown",
"id": "d1715477",
"metadata": {},
"source": [
"Find the module that you want. In this case we know it's a SunPower of model SPR-E19-310-COM. \n",
"\n",
"Make sure you select only 1 module from the database -- sometimes there are similar names."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "fd6a686c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[False False False ... False False False]\n",
"1 modules selected. Name of 1st entry: SunPower SPR-E19-310-COM\n"
]
}
],
"source": [
"modfilter2 = db.index.str.startswith('SunPower') & db.index.str.endswith('SPR-E19-310-COM')\n",
"print(modfilter2)\n",
"CECMod = db[modfilter2]\n",
"print(len(CECMod), \" modules selected. Name of 1st entry: \", CECMod.index[0])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d2db8630",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 6,
"id": "250eb585",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"path = C:\\Users\\cdeline\\Documents\\Python Scripts\\Bifacial_Radiance\\bifacial_radiance\\TEMP\\Tutorial_21\n",
"Getting weather file: USA_VA_Richmond.724010_TMY2.epw\n",
" ... OK!\n",
"8760 line in WeatherFile. Assuming this is a standard hourly WeatherFile for the year for purposes of saving Gencumulativesky temporary weather files in EPW folder.\n",
"Coercing year to 2021\n",
"Filtering dates\n",
"Saving file EPWs\\metdata_temp.csv, # points: 8760\n",
"Calculating Sun position for Metdata that is right-labeled with a delta of -30 mins. i.e. 12 is 11:30 sunpos\n",
"Loading albedo, 1 value(s), 0.200 avg\n",
"1 nonzero albedo values.\n"
]
}
],
"source": [
"# Selecting only two times as examples\n",
"starttime = '01_13_11'; endtime = '01_13_12'\n",
"demo = bifacial_radiance.RadianceObj('tutorial_21', path = testfolder) # Create a RadianceObj 'object'\n",
"weatherfile = demo.getEPW(lat = 37.5, lon = -77.6) # This location corresponds to Richmond, VA.\n",
"metdata = demo.readWeatherFile(weatherFile=weatherfile, starttime=starttime, endtime=endtime)\n",
"demo.setGround(0.2)"
]
},
{
"cell_type": "markdown",
"id": "84a1a789",
"metadata": {},
"source": [
"The CEC data should be passed into the ModuleObj, either at time of creation, or sometime before it is passed into makeScene."
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "9370c9c2",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Module Name: test-module\n",
"Module test-module updated in module.json\n",
"Pre-existing .rad file objects\\test-module.rad will be overwritten\n",
"\n"
]
}
],
"source": [
"mymodule = demo.makeModule(name='test-module', x=1, y=2, bifi=0.9, CECMod=CECMod) "
]
},
{
"cell_type": "markdown",
"id": "27d8bd56",
"metadata": {},
"source": [
"The same data could instead be passed after the ModuleObj's definition, or at time of performance analysis:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "111bdbd2",
"metadata": {},
"outputs": [],
"source": [
"mymodule.addCEC(CECMod)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "1f2e3cd4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Module Name: test\n",
"Module test updated in module.json\n",
"Pre-existing .rad file objects\\test.rad will be overwritten\n",
"\n"
]
}
],
"source": [
"# Let's make a second module, and set it to the default Prism Solar module type\n",
"mymodule2 = demo.makeModule(name='test', x=1, y=2, bifi=0.8, CECMod=None) "
]
},
{
"cell_type": "markdown",
"id": "3ba61504",
"metadata": {},
"source": [
"We're going to set up two scenes, each with a different module type!"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "10e35e7c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Creating ~2 skyfiles. \n",
"Created 2 skyfiles in /skies/\n",
"\n",
"Making ~2 .rad files for gendaylit 1-axis workflow (this takes a minute..)\n",
"2 Radfiles created in /objects/\n"
]
}
],
"source": [
"sceneDict = {'tilt': 0, 'azimuth': 180, 'pitch': 5,'hub_height':1.5, 'nMods':5, 'nRows': 2}\n",
"trackerdict = demo.set1axis(metdata = metdata, cumulativesky = False)\n",
"trackerdict = demo.gendaylit1axis()\n",
"trackerdict = demo.makeScene1axis(trackerdict, module = mymodule, sceneDict = sceneDict)"
]
},
{
"cell_type": "markdown",
"id": "211eddf7",
"metadata": {},
"source": [
"Make a second scene with the other module type"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "29c4a111",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Making ~2 .rad files for gendaylit 1-axis workflow (this takes a minute..)\n",
"2 Radfiles created in /objects/\n"
]
}
],
"source": [
"sceneDict2 = {'tilt': 0, 'azimuth': 180, 'pitch': 5,'hub_height':2.5, 'nMods':2, 'nRows': 1, 'originx': -15}\n",
"trackerdict = demo.makeScene1axis(trackerdict, module = mymodule2, sceneDict=sceneDict2, append=True)\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "71bbd496",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Making 2 octfiles in root directory.\n",
"Created 1axis_2021-01-13_1100.oct\n",
"Created 1axis_2021-01-13_1200.oct\n",
"\n",
"Analysis1axis: append=False. Over-writing any existing `AnalysisObj` in trackerdict.\n",
"\n",
"Linescan in process: 1axis_2021-01-13_1100_Scene0_Row1_Module3_Front\n",
"Linescan in process: 1axis_2021-01-13_1100_Scene0_Row1_Module3_Back\n",
"Saved: results\\irr_1axis_2021-01-13_1100_Scene0_Row1_Module3_Front.csv\n",
"Saved: results\\irr_1axis_2021-01-13_1100_Scene0_Row1_Module3_Back.csv\n",
"Index: 2021-01-13_1100. Wm2Front: 254.26609999999997. Wm2Back: 39.97652333333334\n",
"Linescan in process: 1axis_2021-01-13_1200_Scene0_Row1_Module3_Front\n",
"Linescan in process: 1axis_2021-01-13_1200_Scene0_Row1_Module3_Back\n",
"Saved: results\\irr_1axis_2021-01-13_1200_Scene0_Row1_Module3_Front.csv\n",
"Saved: results\\irr_1axis_2021-01-13_1200_Scene0_Row1_Module3_Back.csv\n",
"Index: 2021-01-13_1200. Wm2Front: 253.4217. Wm2Back: 38.20968333333333\n",
"Linescan in process: 1axis_2021-01-13_1100_Scene1_Row1_Module1_Front\n",
"Linescan in process: 1axis_2021-01-13_1100_Scene1_Row1_Module1_Back\n",
"Saved: results\\irr_1axis_2021-01-13_1100_Scene1_Row1_Module1_Front.csv\n",
"Saved: results\\irr_1axis_2021-01-13_1100_Scene1_Row1_Module1_Back.csv\n",
"Index: 2021-01-13_1100. Wm2Front: 253.54973333333336. Wm2Back: 0.0\n",
"Linescan in process: 1axis_2021-01-13_1200_Scene1_Row1_Module1_Front\n",
"Linescan in process: 1axis_2021-01-13_1200_Scene1_Row1_Module1_Back\n",
"Saved: results\\irr_1axis_2021-01-13_1200_Scene1_Row1_Module1_Front.csv\n",
"Saved: results\\irr_1axis_2021-01-13_1200_Scene1_Row1_Module1_Back.csv\n",
"Index: 2021-01-13_1200. Wm2Front: 252.57203333333334. Wm2Back: 0.0\n"
]
}
],
"source": [
"# Compile both scenes into one octfile. Run 2 different analyses, one on each scene with different front and rear y scan\n",
"trackerdict = demo.makeOct1axis()\n",
"trackerdict = demo.analysis1axis(sensorsy=[1,3], append=False)\n",
"trackerdict = demo.analysis1axis(sensorsy=[3,2], sceneNum=1)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "a3a10f10",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Linescan in process: 1axis_groundscan_2021-01-13_1100Silvanas__Row1_Module1_Front\n",
"Saved: results\\irr_1axis_groundscan_2021-01-13_1100Silvanas__Row1_Module1.csv\n",
"Index: 2021-01-13_1100. Wm2Ground: 204.79288999999997. sensorsground: 10\n",
"Linescan in process: 1axis_groundscan_2021-01-13_1200Silvanas__Row1_Module1_Front\n",
"Saved: results\\irr_1axis_groundscan_2021-01-13_1200Silvanas__Row1_Module1.csv\n",
"Index: 2021-01-13_1200. Wm2Ground: 237.48879000000002. sensorsground: 10\n"
]
}
],
"source": [
"# Include an AgriPV groundscan too\n",
"trackerdict = demo.analysis1axisground(sceneNum=1, sensorsground=10, customname='Silvanas_')"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "2942a802",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" timestamp | \n",
" name | \n",
" modNum | \n",
" rowNum | \n",
" sceneNum | \n",
" Wm2Front | \n",
" Wm2Back | \n",
" backRatio | \n",
" x | \n",
" y | \n",
" z | \n",
" mattype | \n",
" rearX | \n",
" rearY | \n",
" rearZ | \n",
" rearMat | \n",
" surf_azm | \n",
" surf_tilt | \n",
" theta | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 2021-01-13_1100 | \n",
" 1axis_2021-01-13_1100_Scene0 | \n",
" 3 | \n",
" 1 | \n",
" 0 | \n",
" [254.26609999999997] | \n",
" [39.59574, 39.60611, 40.72772] | \n",
" 0.157223 | \n",
" [0.01462555] | \n",
" [0.0] | \n",
" [1.514648] | \n",
" [a2.0.a0.test-module.6457] | \n",
" [0.3581543, -0.0007324219, -0.3596191] | \n",
" [0.0, 0.0, 0.0] | \n",
" [1.151367, 1.499512, 1.847656] | \n",
" [a2.0.a0.test-module.2310, a2.0.a0.test-module... | \n",
" 90.0 | \n",
" 44.14 | \n",
" -44.14 | \n",
"
\n",
" \n",
" | 1 | \n",
" 2021-01-13_1100 | \n",
" 1axis_2021-01-13_1100_Scene1 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [253.0651, 253.8192, 253.7649] | \n",
" [0.0, 0.0] | \n",
" 0.0 | \n",
" [-14.625, -14.98389, -15.34277] | \n",
" [0.0, 0.0, 0.0] | \n",
" [2.166016, 2.51416, 2.862305] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... | \n",
" [-14.75781, -15.23633] | \n",
" [0.0, 0.0] | \n",
" [2.267578, 2.731934] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457] | \n",
" 90.0 | \n",
" 44.14 | \n",
" -44.14 | \n",
"
\n",
" \n",
" | 2 | \n",
" 2021-01-13_1100 | \n",
" 1axis_groundscan_2021-01-13_1100Silvanas_ | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [199.1224, 201.452, 204.5499, 206.0879, 207.14... | \n",
" NaN | \n",
" NaN | \n",
" [-15.0, -14.44434, -13.88867, -13.33301, -12.7... | \n",
" [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... | \n",
" [0.04998779, 0.04998779, 0.04998779, 0.0499877... | \n",
" [groundplane, groundplane, groundplane, ground... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 90.0 | \n",
" 44.14 | \n",
" -44.14 | \n",
"
\n",
" \n",
" | 3 | \n",
" 2021-01-13_1200 | \n",
" 1axis_2021-01-13_1200_Scene0 | \n",
" 3 | \n",
" 1 | \n",
" 0 | \n",
" [253.4217] | \n",
" [37.89736, 37.81097, 38.92072] | \n",
" 0.150775 | \n",
" [0.007595062] | \n",
" [0.0] | \n",
" [1.519531] | \n",
" [a2.0.a0.test-module.6457] | \n",
" [0.4658203, -0.0002441406, -0.4663086] | \n",
" [0.0, 0.0, 0.0] | \n",
" [1.318359, 1.499146, 1.679932] | \n",
" [a2.0.a0.test-module.2310, a2.0.a0.test-module... | \n",
" 90.0 | \n",
" 21.20 | \n",
" -21.20 | \n",
"
\n",
" \n",
" | 4 | \n",
" 2021-01-13_1200 | \n",
" 1axis_2021-01-13_1200_Scene1 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [252.4514, 252.5719, 252.6928] | \n",
" [0.0, 0.0] | \n",
" 0.0 | \n",
" [-14.52344, -14.9895, -15.45557] | \n",
" [0.0, 0.0, 0.0] | \n",
" [2.337891, 2.518677, 2.699463] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... | \n",
" [-14.6875, -15.30908] | \n",
" [0.0, 0.0] | \n",
" [2.378906, 2.619995] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457] | \n",
" 90.0 | \n",
" 21.20 | \n",
" -21.20 | \n",
"
\n",
" \n",
" | 5 | \n",
" 2021-01-13_1200 | \n",
" 1axis_groundscan_2021-01-13_1200Silvanas_ | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [227.9177, 230.1437, 233.8727, 236.2223, 238.9... | \n",
" NaN | \n",
" NaN | \n",
" [-15.0, -14.44434, -13.88867, -13.33301, -12.7... | \n",
" [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... | \n",
" [0.04998779, 0.04998779, 0.04998779, 0.0499877... | \n",
" [groundplane, groundplane, groundplane, ground... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 90.0 | \n",
" 21.20 | \n",
" -21.20 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" timestamp name modNum rowNum \\\n",
"0 2021-01-13_1100 1axis_2021-01-13_1100_Scene0 3 1 \n",
"1 2021-01-13_1100 1axis_2021-01-13_1100_Scene1 1 1 \n",
"2 2021-01-13_1100 1axis_groundscan_2021-01-13_1100Silvanas_ 1 1 \n",
"3 2021-01-13_1200 1axis_2021-01-13_1200_Scene0 3 1 \n",
"4 2021-01-13_1200 1axis_2021-01-13_1200_Scene1 1 1 \n",
"5 2021-01-13_1200 1axis_groundscan_2021-01-13_1200Silvanas_ 1 1 \n",
"\n",
" sceneNum Wm2Front \\\n",
"0 0 [254.26609999999997] \n",
"1 1 [253.0651, 253.8192, 253.7649] \n",
"2 1 [199.1224, 201.452, 204.5499, 206.0879, 207.14... \n",
"3 0 [253.4217] \n",
"4 1 [252.4514, 252.5719, 252.6928] \n",
"5 1 [227.9177, 230.1437, 233.8727, 236.2223, 238.9... \n",
"\n",
" Wm2Back backRatio \\\n",
"0 [39.59574, 39.60611, 40.72772] 0.157223 \n",
"1 [0.0, 0.0] 0.0 \n",
"2 NaN NaN \n",
"3 [37.89736, 37.81097, 38.92072] 0.150775 \n",
"4 [0.0, 0.0] 0.0 \n",
"5 NaN NaN \n",
"\n",
" x \\\n",
"0 [0.01462555] \n",
"1 [-14.625, -14.98389, -15.34277] \n",
"2 [-15.0, -14.44434, -13.88867, -13.33301, -12.7... \n",
"3 [0.007595062] \n",
"4 [-14.52344, -14.9895, -15.45557] \n",
"5 [-15.0, -14.44434, -13.88867, -13.33301, -12.7... \n",
"\n",
" y \\\n",
"0 [0.0] \n",
"1 [0.0, 0.0, 0.0] \n",
"2 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... \n",
"3 [0.0] \n",
"4 [0.0, 0.0, 0.0] \n",
"5 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... \n",
"\n",
" z \\\n",
"0 [1.514648] \n",
"1 [2.166016, 2.51416, 2.862305] \n",
"2 [0.04998779, 0.04998779, 0.04998779, 0.0499877... \n",
"3 [1.519531] \n",
"4 [2.337891, 2.518677, 2.699463] \n",
"5 [0.04998779, 0.04998779, 0.04998779, 0.0499877... \n",
"\n",
" mattype \\\n",
"0 [a2.0.a0.test-module.6457] \n",
"1 [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... \n",
"2 [groundplane, groundplane, groundplane, ground... \n",
"3 [a2.0.a0.test-module.6457] \n",
"4 [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... \n",
"5 [groundplane, groundplane, groundplane, ground... \n",
"\n",
" rearX rearY \\\n",
"0 [0.3581543, -0.0007324219, -0.3596191] [0.0, 0.0, 0.0] \n",
"1 [-14.75781, -15.23633] [0.0, 0.0] \n",
"2 NaN NaN \n",
"3 [0.4658203, -0.0002441406, -0.4663086] [0.0, 0.0, 0.0] \n",
"4 [-14.6875, -15.30908] [0.0, 0.0] \n",
"5 NaN NaN \n",
"\n",
" rearZ \\\n",
"0 [1.151367, 1.499512, 1.847656] \n",
"1 [2.267578, 2.731934] \n",
"2 NaN \n",
"3 [1.318359, 1.499146, 1.679932] \n",
"4 [2.378906, 2.619995] \n",
"5 NaN \n",
"\n",
" rearMat surf_azm surf_tilt \\\n",
"0 [a2.0.a0.test-module.2310, a2.0.a0.test-module... 90.0 44.14 \n",
"1 [a0.0.a0.test.6457, a0.0.a0.test.6457] 90.0 44.14 \n",
"2 NaN 90.0 44.14 \n",
"3 [a2.0.a0.test-module.2310, a2.0.a0.test-module... 90.0 21.20 \n",
"4 [a0.0.a0.test.6457, a0.0.a0.test.6457] 90.0 21.20 \n",
"5 NaN 90.0 21.20 \n",
"\n",
" theta \n",
"0 -44.14 \n",
"1 -44.14 \n",
"2 -44.14 \n",
"3 -21.20 \n",
"4 -21.20 \n",
"5 -21.20 "
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# show the initial irradiance results before continuing:\n",
"demo.results"
]
},
{
"cell_type": "markdown",
"id": "7ec0639a",
"metadata": {},
"source": [
"## Calculating the Performance and Exporting the Results to a CSV"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "7bbf6db6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"No CECModule data passed; using default for Prism Solar BHC72-400\n",
"\n",
"Compiled results:\n",
"\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" timestamp | \n",
" name | \n",
" modNum | \n",
" rowNum | \n",
" sceneNum | \n",
" Wm2Front | \n",
" Wm2Back | \n",
" backRatio | \n",
" x | \n",
" y | \n",
" z | \n",
" mattype | \n",
" rearX | \n",
" rearY | \n",
" rearZ | \n",
" rearMat | \n",
" POA_eff | \n",
" Gfront_mean | \n",
" Grear_mean | \n",
" Pout_raw | \n",
" Pout_Gfront | \n",
" BGG | \n",
" BGE | \n",
" Mismatch | \n",
" Pout | \n",
" Wind Speed | \n",
" DNI | \n",
" DHI | \n",
" GHI | \n",
" module_CEC_name | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 2021-01-13_1100 | \n",
" 1axis_2021-01-13_1100_Scene0 | \n",
" 3 | \n",
" 1 | \n",
" 0 | \n",
" [254.26609999999997] | \n",
" [39.59574, 39.60611, 40.72772] | \n",
" 0.157223 | \n",
" [0.01462555] | \n",
" [0.0] | \n",
" [1.514648] | \n",
" [a2.0.a0.test-module.6457] | \n",
" [0.3581543, -0.0007324219, -0.3596191] | \n",
" [0.0, 0.0, 0.0] | \n",
" [1.151367, 1.499512, 1.847656] | \n",
" [a2.0.a0.test-module.2310, a2.0.a0.test-module... | \n",
" 290.244971 | \n",
" 254.266100 | \n",
" 39.976523 | \n",
" 91.775968 | \n",
" 80.310389 | \n",
" 14.150086 | \n",
" 14.276583 | \n",
" 0.022931 | \n",
" 91.754923 | \n",
" 3.8 | \n",
" 144 | \n",
" 149 | \n",
" 211 | \n",
" SunPower SPR-E19-310-COM | \n",
"
\n",
" \n",
" | 1 | \n",
" 2021-01-13_1100 | \n",
" 1axis_2021-01-13_1100_Scene1 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [253.0651, 253.8192, 253.7649] | \n",
" [0.0, 0.0] | \n",
" 0.0 | \n",
" [-14.625, -14.98389, -15.34277] | \n",
" [0.0, 0.0, 0.0] | \n",
" [2.166016, 2.51416, 2.862305] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... | \n",
" [-14.75781, -15.23633] | \n",
" [0.0, 0.0] | \n",
" [2.267578, 2.731934] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457] | \n",
" 253.549733 | \n",
" 253.549733 | \n",
" 0.000000 | \n",
" 106.072139 | \n",
" 106.072139 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 106.072139 | \n",
" 3.8 | \n",
" 144 | \n",
" 149 | \n",
" 211 | \n",
" Prism Solar Technologies Inc. BHC72-400 | \n",
"
\n",
" \n",
" | 2 | \n",
" 2021-01-13_1100 | \n",
" 1axis_groundscan_2021-01-13_1100Silvanas_ | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [199.1224, 201.452, 204.5499, 206.0879, 207.14... | \n",
" NaN | \n",
" NaN | \n",
" [-15.0, -14.44434, -13.88867, -13.33301, -12.7... | \n",
" [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... | \n",
" [0.04998779, 0.04998779, 0.04998779, 0.0499877... | \n",
" [groundplane, groundplane, groundplane, ground... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 204.792890 | \n",
" 204.792890 | \n",
" 0.000000 | \n",
" 85.584512 | \n",
" 85.584512 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 85.584512 | \n",
" 3.8 | \n",
" 144 | \n",
" 149 | \n",
" 211 | \n",
" Prism Solar Technologies Inc. BHC72-400 | \n",
"
\n",
" \n",
" | 3 | \n",
" 2021-01-13_1200 | \n",
" 1axis_2021-01-13_1200_Scene0 | \n",
" 3 | \n",
" 1 | \n",
" 0 | \n",
" [253.4217] | \n",
" [37.89736, 37.81097, 38.92072] | \n",
" 0.150775 | \n",
" [0.007595062] | \n",
" [0.0] | \n",
" [1.519531] | \n",
" [a2.0.a0.test-module.6457] | \n",
" [0.4658203, -0.0002441406, -0.4663086] | \n",
" [0.0, 0.0, 0.0] | \n",
" [1.318359, 1.499146, 1.679932] | \n",
" [a2.0.a0.test-module.2310, a2.0.a0.test-module... | \n",
" 287.810415 | \n",
" 253.421700 | \n",
" 38.209683 | \n",
" 90.333308 | \n",
" 79.448352 | \n",
" 13.569759 | \n",
" 13.700669 | \n",
" 0.022662 | \n",
" 90.312836 | \n",
" 3.9 | \n",
" 97 | \n",
" 200 | \n",
" 249 | \n",
" SunPower SPR-E19-310-COM | \n",
"
\n",
" \n",
" | 4 | \n",
" 2021-01-13_1200 | \n",
" 1axis_2021-01-13_1200_Scene1 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [252.4514, 252.5719, 252.6928] | \n",
" [0.0, 0.0] | \n",
" 0.0 | \n",
" [-14.52344, -14.9895, -15.45557] | \n",
" [0.0, 0.0, 0.0] | \n",
" [2.337891, 2.518677, 2.699463] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... | \n",
" [-14.6875, -15.30908] | \n",
" [0.0, 0.0] | \n",
" [2.378906, 2.619995] | \n",
" [a0.0.a0.test.6457, a0.0.a0.test.6457] | \n",
" 252.572033 | \n",
" 252.572033 | \n",
" 0.000000 | \n",
" 104.950213 | \n",
" 104.950213 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 104.950213 | \n",
" 3.9 | \n",
" 97 | \n",
" 200 | \n",
" 249 | \n",
" Prism Solar Technologies Inc. BHC72-400 | \n",
"
\n",
" \n",
" | 5 | \n",
" 2021-01-13_1200 | \n",
" 1axis_groundscan_2021-01-13_1200Silvanas_ | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" [227.9177, 230.1437, 233.8727, 236.2223, 238.9... | \n",
" NaN | \n",
" NaN | \n",
" [-15.0, -14.44434, -13.88867, -13.33301, -12.7... | \n",
" [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... | \n",
" [0.04998779, 0.04998779, 0.04998779, 0.0499877... | \n",
" [groundplane, groundplane, groundplane, ground... | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 237.488790 | \n",
" 237.488790 | \n",
" 0.000000 | \n",
" 98.665486 | \n",
" 98.665486 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
" 98.665486 | \n",
" 3.9 | \n",
" 97 | \n",
" 200 | \n",
" 249 | \n",
" Prism Solar Technologies Inc. BHC72-400 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" timestamp name modNum rowNum \\\n",
"0 2021-01-13_1100 1axis_2021-01-13_1100_Scene0 3 1 \n",
"1 2021-01-13_1100 1axis_2021-01-13_1100_Scene1 1 1 \n",
"2 2021-01-13_1100 1axis_groundscan_2021-01-13_1100Silvanas_ 1 1 \n",
"3 2021-01-13_1200 1axis_2021-01-13_1200_Scene0 3 1 \n",
"4 2021-01-13_1200 1axis_2021-01-13_1200_Scene1 1 1 \n",
"5 2021-01-13_1200 1axis_groundscan_2021-01-13_1200Silvanas_ 1 1 \n",
"\n",
" sceneNum Wm2Front \\\n",
"0 0 [254.26609999999997] \n",
"1 1 [253.0651, 253.8192, 253.7649] \n",
"2 1 [199.1224, 201.452, 204.5499, 206.0879, 207.14... \n",
"3 0 [253.4217] \n",
"4 1 [252.4514, 252.5719, 252.6928] \n",
"5 1 [227.9177, 230.1437, 233.8727, 236.2223, 238.9... \n",
"\n",
" Wm2Back backRatio \\\n",
"0 [39.59574, 39.60611, 40.72772] 0.157223 \n",
"1 [0.0, 0.0] 0.0 \n",
"2 NaN NaN \n",
"3 [37.89736, 37.81097, 38.92072] 0.150775 \n",
"4 [0.0, 0.0] 0.0 \n",
"5 NaN NaN \n",
"\n",
" x \\\n",
"0 [0.01462555] \n",
"1 [-14.625, -14.98389, -15.34277] \n",
"2 [-15.0, -14.44434, -13.88867, -13.33301, -12.7... \n",
"3 [0.007595062] \n",
"4 [-14.52344, -14.9895, -15.45557] \n",
"5 [-15.0, -14.44434, -13.88867, -13.33301, -12.7... \n",
"\n",
" y \\\n",
"0 [0.0] \n",
"1 [0.0, 0.0, 0.0] \n",
"2 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... \n",
"3 [0.0] \n",
"4 [0.0, 0.0, 0.0] \n",
"5 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... \n",
"\n",
" z \\\n",
"0 [1.514648] \n",
"1 [2.166016, 2.51416, 2.862305] \n",
"2 [0.04998779, 0.04998779, 0.04998779, 0.0499877... \n",
"3 [1.519531] \n",
"4 [2.337891, 2.518677, 2.699463] \n",
"5 [0.04998779, 0.04998779, 0.04998779, 0.0499877... \n",
"\n",
" mattype \\\n",
"0 [a2.0.a0.test-module.6457] \n",
"1 [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... \n",
"2 [groundplane, groundplane, groundplane, ground... \n",
"3 [a2.0.a0.test-module.6457] \n",
"4 [a0.0.a0.test.6457, a0.0.a0.test.6457, a0.0.a0... \n",
"5 [groundplane, groundplane, groundplane, ground... \n",
"\n",
" rearX rearY \\\n",
"0 [0.3581543, -0.0007324219, -0.3596191] [0.0, 0.0, 0.0] \n",
"1 [-14.75781, -15.23633] [0.0, 0.0] \n",
"2 NaN NaN \n",
"3 [0.4658203, -0.0002441406, -0.4663086] [0.0, 0.0, 0.0] \n",
"4 [-14.6875, -15.30908] [0.0, 0.0] \n",
"5 NaN NaN \n",
"\n",
" rearZ \\\n",
"0 [1.151367, 1.499512, 1.847656] \n",
"1 [2.267578, 2.731934] \n",
"2 NaN \n",
"3 [1.318359, 1.499146, 1.679932] \n",
"4 [2.378906, 2.619995] \n",
"5 NaN \n",
"\n",
" rearMat POA_eff Gfront_mean \\\n",
"0 [a2.0.a0.test-module.2310, a2.0.a0.test-module... 290.244971 254.266100 \n",
"1 [a0.0.a0.test.6457, a0.0.a0.test.6457] 253.549733 253.549733 \n",
"2 NaN 204.792890 204.792890 \n",
"3 [a2.0.a0.test-module.2310, a2.0.a0.test-module... 287.810415 253.421700 \n",
"4 [a0.0.a0.test.6457, a0.0.a0.test.6457] 252.572033 252.572033 \n",
"5 NaN 237.488790 237.488790 \n",
"\n",
" Grear_mean Pout_raw Pout_Gfront BGG BGE Mismatch \\\n",
"0 39.976523 91.775968 80.310389 14.150086 14.276583 0.022931 \n",
"1 0.000000 106.072139 106.072139 0.000000 0.000000 0.000000 \n",
"2 0.000000 85.584512 85.584512 0.000000 0.000000 0.000000 \n",
"3 38.209683 90.333308 79.448352 13.569759 13.700669 0.022662 \n",
"4 0.000000 104.950213 104.950213 0.000000 0.000000 0.000000 \n",
"5 0.000000 98.665486 98.665486 0.000000 0.000000 0.000000 \n",
"\n",
" Pout Wind Speed DNI DHI GHI \\\n",
"0 91.754923 3.8 144 149 211 \n",
"1 106.072139 3.8 144 149 211 \n",
"2 85.584512 3.8 144 149 211 \n",
"3 90.312836 3.9 97 200 249 \n",
"4 104.950213 3.9 97 200 249 \n",
"5 98.665486 3.9 97 200 249 \n",
"\n",
" module_CEC_name \n",
"0 SunPower SPR-E19-310-COM \n",
"1 Prism Solar Technologies Inc. BHC72-400 \n",
"2 Prism Solar Technologies Inc. BHC72-400 \n",
"3 SunPower SPR-E19-310-COM \n",
"4 Prism Solar Technologies Inc. BHC72-400 \n",
"5 Prism Solar Technologies Inc. BHC72-400 "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Calculate performance.\n",
"pd.set_option('display.max_columns', 1000); \n",
"compiledResults = demo.calculatePerformance1axis()\n",
"print(f'\\nCompiled results:\\n')\n",
"display(compiledResults)\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "fe18ea62",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Exporting TrackerDict\n",
"3\n",
"3\n",
"1\n",
"1\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Unnamed: 0 | \n",
" timestamp | \n",
" rowNum | \n",
" modNum | \n",
" sceneNum | \n",
" name | \n",
" Wm2Front | \n",
" Wm2Back | \n",
" DNI | \n",
" DHI | \n",
" GHI | \n",
" temp_air | \n",
" wind_speed | \n",
" theta | \n",
" surf_tilt | \n",
" surf_azm | \n",
" POA_eff | \n",
" Gfront_mean | \n",
" Grear_mean | \n",
" Pout_raw | \n",
" Mismatch | \n",
" Pout | \n",
" Pout_Gfront | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0 | \n",
" 2021-01-13_1100 | \n",
" 1 | \n",
" 3 | \n",
" 0 | \n",
" 1axis_2021-01-13_1100_Scene0 | \n",
" [254.2661] | \n",
" [39.59574 39.60611 40.72772] | \n",
" 144 | \n",
" 149 | \n",
" 211 | \n",
" NaN | \n",
" 3.8 | \n",
" -44.14 | \n",
" 44.14 | \n",
" 90.0 | \n",
" 290.244971 | \n",
" 254.266100 | \n",
" 39.976523 | \n",
" 91.775968 | \n",
" 0.022931 | \n",
" 91.754923 | \n",
" 80.310389 | \n",
"
\n",
" \n",
" | 1 | \n",
" 1 | \n",
" 2021-01-13_1100 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" 1axis_2021-01-13_1100_Scene1 | \n",
" [253.0651 253.8192 253.7649] | \n",
" [0. 0.] | \n",
" 144 | \n",
" 149 | \n",
" 211 | \n",
" NaN | \n",
" 3.8 | \n",
" -44.14 | \n",
" 44.14 | \n",
" 90.0 | \n",
" 253.549733 | \n",
" 253.549733 | \n",
" 0.000000 | \n",
" 106.072139 | \n",
" 0.000000 | \n",
" 106.072139 | \n",
" 106.072139 | \n",
"
\n",
" \n",
" | 2 | \n",
" 2 | \n",
" 2021-01-13_1100 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" 1axis_groundscan_2021-01-13_1100Silvanas_ | \n",
" [199.1224 201.452 204.5499 206.0879 207.1438 ... | \n",
" NaN | \n",
" 144 | \n",
" 149 | \n",
" 211 | \n",
" NaN | \n",
" 3.8 | \n",
" -44.14 | \n",
" 44.14 | \n",
" 90.0 | \n",
" 204.792890 | \n",
" 204.792890 | \n",
" 0.000000 | \n",
" 85.584512 | \n",
" 0.000000 | \n",
" 85.584512 | \n",
" 85.584512 | \n",
"
\n",
" \n",
" | 3 | \n",
" 3 | \n",
" 2021-01-13_1200 | \n",
" 1 | \n",
" 3 | \n",
" 0 | \n",
" 1axis_2021-01-13_1200_Scene0 | \n",
" [253.4217] | \n",
" [37.89736 37.81097 38.92072] | \n",
" 97 | \n",
" 200 | \n",
" 249 | \n",
" NaN | \n",
" 3.9 | \n",
" -21.20 | \n",
" 21.20 | \n",
" 90.0 | \n",
" 287.810415 | \n",
" 253.421700 | \n",
" 38.209683 | \n",
" 90.333308 | \n",
" 0.022662 | \n",
" 90.312836 | \n",
" 79.448352 | \n",
"
\n",
" \n",
" | 4 | \n",
" 4 | \n",
" 2021-01-13_1200 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" 1axis_2021-01-13_1200_Scene1 | \n",
" [252.4514 252.5719 252.6928] | \n",
" [0. 0.] | \n",
" 97 | \n",
" 200 | \n",
" 249 | \n",
" NaN | \n",
" 3.9 | \n",
" -21.20 | \n",
" 21.20 | \n",
" 90.0 | \n",
" 252.572033 | \n",
" 252.572033 | \n",
" 0.000000 | \n",
" 104.950213 | \n",
" 0.000000 | \n",
" 104.950213 | \n",
" 104.950213 | \n",
"
\n",
" \n",
" | 5 | \n",
" 5 | \n",
" 2021-01-13_1200 | \n",
" 1 | \n",
" 1 | \n",
" 1 | \n",
" 1axis_groundscan_2021-01-13_1200Silvanas_ | \n",
" [227.9177 230.1437 233.8727 236.2223 238.9651 ... | \n",
" NaN | \n",
" 97 | \n",
" 200 | \n",
" 249 | \n",
" NaN | \n",
" 3.9 | \n",
" -21.20 | \n",
" 21.20 | \n",
" 90.0 | \n",
" 237.488790 | \n",
" 237.488790 | \n",
" 0.000000 | \n",
" 98.665486 | \n",
" 0.000000 | \n",
" 98.665486 | \n",
" 98.665486 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Unnamed: 0 timestamp rowNum modNum sceneNum \\\n",
"0 0 2021-01-13_1100 1 3 0 \n",
"1 1 2021-01-13_1100 1 1 1 \n",
"2 2 2021-01-13_1100 1 1 1 \n",
"3 3 2021-01-13_1200 1 3 0 \n",
"4 4 2021-01-13_1200 1 1 1 \n",
"5 5 2021-01-13_1200 1 1 1 \n",
"\n",
" name \\\n",
"0 1axis_2021-01-13_1100_Scene0 \n",
"1 1axis_2021-01-13_1100_Scene1 \n",
"2 1axis_groundscan_2021-01-13_1100Silvanas_ \n",
"3 1axis_2021-01-13_1200_Scene0 \n",
"4 1axis_2021-01-13_1200_Scene1 \n",
"5 1axis_groundscan_2021-01-13_1200Silvanas_ \n",
"\n",
" Wm2Front \\\n",
"0 [254.2661] \n",
"1 [253.0651 253.8192 253.7649] \n",
"2 [199.1224 201.452 204.5499 206.0879 207.1438 ... \n",
"3 [253.4217] \n",
"4 [252.4514 252.5719 252.6928] \n",
"5 [227.9177 230.1437 233.8727 236.2223 238.9651 ... \n",
"\n",
" Wm2Back DNI DHI GHI temp_air wind_speed theta \\\n",
"0 [39.59574 39.60611 40.72772] 144 149 211 NaN 3.8 -44.14 \n",
"1 [0. 0.] 144 149 211 NaN 3.8 -44.14 \n",
"2 NaN 144 149 211 NaN 3.8 -44.14 \n",
"3 [37.89736 37.81097 38.92072] 97 200 249 NaN 3.9 -21.20 \n",
"4 [0. 0.] 97 200 249 NaN 3.9 -21.20 \n",
"5 NaN 97 200 249 NaN 3.9 -21.20 \n",
"\n",
" surf_tilt surf_azm POA_eff Gfront_mean Grear_mean Pout_raw \\\n",
"0 44.14 90.0 290.244971 254.266100 39.976523 91.775968 \n",
"1 44.14 90.0 253.549733 253.549733 0.000000 106.072139 \n",
"2 44.14 90.0 204.792890 204.792890 0.000000 85.584512 \n",
"3 21.20 90.0 287.810415 253.421700 38.209683 90.333308 \n",
"4 21.20 90.0 252.572033 252.572033 0.000000 104.950213 \n",
"5 21.20 90.0 237.488790 237.488790 0.000000 98.665486 \n",
"\n",
" Mismatch Pout Pout_Gfront \n",
"0 0.022931 91.754923 80.310389 \n",
"1 0.000000 106.072139 106.072139 \n",
"2 0.000000 85.584512 85.584512 \n",
"3 0.022662 90.312836 79.448352 \n",
"4 0.000000 104.950213 104.950213 \n",
"5 0.000000 98.665486 98.665486 "
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"demo.exportTrackerDict(savefile=os.path.join('results','Final_Results.csv'),reindex=False)\n",
"pd.read_csv(os.path.join('results','Final_Results.csv'))"
]
},
{
"cell_type": "markdown",
"id": "eb2202f4",
"metadata": {},
"source": [
"## Now look at gencumulativesky tracking workflow"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "7cd42dfc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"path = C:\\Users\\cdeline\\Documents\\Python Scripts\\Bifacial_Radiance\\bifacial_radiance\\TEMP\\Tutorial_21\n",
"Getting weather file: USA_VA_Richmond.724010_TMY2.epw\n",
" ... OK!\n",
"8760 line in WeatherFile. Assuming this is a standard hourly WeatherFile for the year for purposes of saving Gencumulativesky temporary weather files in EPW folder.\n",
"Coercing year to 2021\n",
"Filtering dates\n",
"Saving file EPWs\\metdata_temp.csv, # points: 8760\n",
"Calculating Sun position for Metdata that is right-labeled with a delta of -30 mins. i.e. 12 is 11:30 sunpos\n",
"Loading albedo, 1 value(s), 0.200 avg\n",
"1 nonzero albedo values.\n",
"\n",
"Module Name: test-module\n",
"Module test-module updated in module.json\n",
"Pre-existing .rad file objects\\test-module.rad will be overwritten\n",
"\n"
]
}
],
"source": [
"starttime = '01_13_11'; endtime = '12_13_12'\n",
"demo = bifacial_radiance.RadianceObj('tutorial_21', path = testfolder) # Create a RadianceObj 'object'\n",
"weatherfile = demo.getEPW(lat = 37.5, lon = -77.6) # This location corresponds to Richmond, VA.\n",
"metdata = demo.readWeatherFile(weatherFile=weatherfile, starttime=starttime, endtime=endtime)\n",
"#metdata = demo.readWeatherFile(weatherFile=weatherfile)\n",
"demo.setGround(0.2)\n",
"mymodule = demo.makeModule(name='test-module', x=1, y=2, bifi=0.9, CECMod=CECMod) "
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "893d060e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saving file EPWs\\1axis_-15.0.csv, # points: 1875\n",
"Saving file EPWs\\1axis_-10.0.csv, # points: 241\n",
"Saving file EPWs\\1axis_0.0.csv, # points: 2\n",
"Saving file EPWs\\1axis_5.0.csv, # points: 242\n",
"Saving file EPWs\\1axis_10.0.csv, # points: 33\n",
"Saving file EPWs\\1axis_15.0.csv, # points: 1683\n",
"message: There were 1833 sun up hours in this climate file\n",
"Total Ibh/Lbh: 0.000000\n",
"Created skyfile skies\\1axis_-15.0.rad\n",
"message: There were 238 sun up hours in this climate file\n",
"Total Ibh/Lbh: 0.000000\n",
"Created skyfile skies\\1axis_-10.0.rad\n",
"message: There were 2 sun up hours in this climate file\n",
"Total Ibh/Lbh: 0.000000\n",
"Created skyfile skies\\1axis_0.0.rad\n",
"message: There were 239 sun up hours in this climate file\n",
"Total Ibh/Lbh: 0.000000\n",
"Created skyfile skies\\1axis_5.0.rad\n",
"message: There were 33 sun up hours in this climate file\n",
"Total Ibh/Lbh: 0.000000\n",
"Created skyfile skies\\1axis_10.0.rad\n",
"message: There were 1661 sun up hours in this climate file\n",
"Total Ibh/Lbh: 0.000000\n",
"Created skyfile skies\\1axis_15.0.rad\n",
"\n",
"Making .rad files for cumulativesky 1-axis workflow\n",
"6 Radfiles created in /objects/\n",
"\n",
"Making 6 octfiles in root directory.\n",
"Created 1axis_-15.0.oct\n",
"Created 1axis_-10.0.oct\n",
"Created 1axis_0.0.oct\n",
"Created 1axis_5.0.oct\n",
"Created 1axis_10.0.oct\n",
"Created 1axis_15.0.oct\n",
"Linescan in process: 1axis_-15.0_Scene0_Row1_Module2_Front\n",
"Linescan in process: 1axis_-15.0_Scene0_Row1_Module2_Back\n",
"Saved: results\\irr_1axis_-15.0_Scene0_Row1_Module2_Front.csv\n",
"Saved: results\\irr_1axis_-15.0_Scene0_Row1_Module2_Back.csv\n",
"Index: -15.0. Wm2Front: 627314.8999999999. Wm2Back: 80826.80666666666\n",
"Linescan in process: 1axis_-15.0_Scene0_Row1_Module4_Front\n",
"Linescan in process: 1axis_-15.0_Scene0_Row1_Module4_Back\n",
"Saved: results\\irr_1axis_-15.0_Scene0_Row1_Module4_Front.csv\n",
"Saved: results\\irr_1axis_-15.0_Scene0_Row1_Module4_Back.csv\n",
"Index: -15.0. Wm2Front: 633150.2. Wm2Back: 74338.82666666668\n",
"Linescan in process: 1axis_-10.0_Scene0_Row1_Module2_Front\n",
"Linescan in process: 1axis_-10.0_Scene0_Row1_Module2_Back\n",
"Saved: results\\irr_1axis_-10.0_Scene0_Row1_Module2_Front.csv\n",
"Saved: results\\irr_1axis_-10.0_Scene0_Row1_Module2_Back.csv\n",
"Index: -10.0. Wm2Front: 146242.85. Wm2Back: 19780.77666666667\n",
"Linescan in process: 1axis_-10.0_Scene0_Row1_Module4_Front\n",
"Linescan in process: 1axis_-10.0_Scene0_Row1_Module4_Back\n",
"Saved: results\\irr_1axis_-10.0_Scene0_Row1_Module4_Front.csv\n",
"Saved: results\\irr_1axis_-10.0_Scene0_Row1_Module4_Back.csv\n",
"Index: -10.0. Wm2Front: 148151.5. Wm2Back: 17382.633333333335\n",
"Linescan in process: 1axis_0.0_Scene0_Row1_Module2_Front\n",
"Linescan in process: 1axis_0.0_Scene0_Row1_Module2_Back\n",
"Saved: results\\irr_1axis_0.0_Scene0_Row1_Module2_Front.csv\n",
"Saved: results\\irr_1axis_0.0_Scene0_Row1_Module2_Back.csv\n",
"Index: 0.0. Wm2Front: 967.20935. Wm2Back: 151.3741\n",
"Linescan in process: 1axis_0.0_Scene0_Row1_Module4_Front\n",
"Linescan in process: 1axis_0.0_Scene0_Row1_Module4_Back\n",
"Saved: results\\irr_1axis_0.0_Scene0_Row1_Module4_Front.csv\n",
"Saved: results\\irr_1axis_0.0_Scene0_Row1_Module4_Back.csv\n",
"Index: 0.0. Wm2Front: 1004.4355. Wm2Back: 118.55160000000001\n",
"Linescan in process: 1axis_5.0_Scene0_Row1_Module2_Front\n",
"Linescan in process: 1axis_5.0_Scene0_Row1_Module2_Back\n",
"Saved: results\\irr_1axis_5.0_Scene0_Row1_Module2_Front.csv\n",
"Saved: results\\irr_1axis_5.0_Scene0_Row1_Module2_Back.csv\n",
"Index: 5.0. Wm2Front: 149129.2. Wm2Back: 19709.866666666665\n",
"Linescan in process: 1axis_5.0_Scene0_Row1_Module4_Front\n",
"Linescan in process: 1axis_5.0_Scene0_Row1_Module4_Back\n",
"Saved: results\\irr_1axis_5.0_Scene0_Row1_Module4_Front.csv\n",
"Saved: results\\irr_1axis_5.0_Scene0_Row1_Module4_Back.csv\n",
"Index: 5.0. Wm2Front: 149867.15000000002. Wm2Back: 17504.570000000003\n",
"Linescan in process: 1axis_10.0_Scene0_Row1_Module2_Front\n",
"Linescan in process: 1axis_10.0_Scene0_Row1_Module2_Back\n",
"Saved: results\\irr_1axis_10.0_Scene0_Row1_Module2_Front.csv\n",
"Saved: results\\irr_1axis_10.0_Scene0_Row1_Module2_Back.csv\n",
"Index: 10.0. Wm2Front: 17213.73. Wm2Back: 2419.6253333333334\n",
"Linescan in process: 1axis_10.0_Scene0_Row1_Module4_Front\n",
"Linescan in process: 1axis_10.0_Scene0_Row1_Module4_Back\n",
"Saved: results\\irr_1axis_10.0_Scene0_Row1_Module4_Front.csv\n",
"Saved: results\\irr_1axis_10.0_Scene0_Row1_Module4_Back.csv\n",
"Index: 10.0. Wm2Front: 17476.864999999998. Wm2Back: 2028.0343333333333\n",
"Linescan in process: 1axis_15.0_Scene0_Row1_Module2_Front\n",
"Linescan in process: 1axis_15.0_Scene0_Row1_Module2_Back\n",
"Saved: results\\irr_1axis_15.0_Scene0_Row1_Module2_Front.csv\n",
"Saved: results\\irr_1axis_15.0_Scene0_Row1_Module2_Back.csv\n",
"Index: 15.0. Wm2Front: 714340.8500000001. Wm2Back: 86047.87\n",
"Linescan in process: 1axis_15.0_Scene0_Row1_Module4_Front\n",
"Linescan in process: 1axis_15.0_Scene0_Row1_Module4_Back\n",
"Saved: results\\irr_1axis_15.0_Scene0_Row1_Module4_Front.csv\n",
"Saved: results\\irr_1axis_15.0_Scene0_Row1_Module4_Back.csv\n",
"Index: 15.0. Wm2Front: 721632.25. Wm2Back: 79538.19666666667\n",
"Linescan in process: 1axis_groundscan_-15.0_Row1_Module3_Front\n",
"Saved: results\\irr_1axis_groundscan_-15.0_Row1_Module3.csv\n",
"Index: -15.0. Wm2Ground: 495183.01000000007. sensorsground: 10\n",
"Linescan in process: 1axis_groundscan_-10.0_Row1_Module3_Front\n",
"Saved: results\\irr_1axis_groundscan_-10.0_Row1_Module3.csv\n",
"Index: -10.0. Wm2Ground: 118693.192. sensorsground: 10\n",
"Linescan in process: 1axis_groundscan_0.0_Row1_Module3_Front\n",
"Saved: results\\irr_1axis_groundscan_0.0_Row1_Module3.csv\n",
"Index: 0.0. Wm2Ground: 722.9592299999999. sensorsground: 10\n",
"Linescan in process: 1axis_groundscan_5.0_Row1_Module3_Front\n",
"Saved: results\\irr_1axis_groundscan_5.0_Row1_Module3.csv\n",
"Index: 5.0. Wm2Ground: 110024.954. sensorsground: 10\n",
"Linescan in process: 1axis_groundscan_10.0_Row1_Module3_Front\n",
"Saved: results\\irr_1axis_groundscan_10.0_Row1_Module3.csv\n",
"Index: 10.0. Wm2Ground: 12419.3521. sensorsground: 10\n",
"Linescan in process: 1axis_groundscan_15.0_Row1_Module3_Front\n",
"Saved: results\\irr_1axis_groundscan_15.0_Row1_Module3.csv\n",
"Index: 15.0. Wm2Ground: 388078.31. sensorsground: 10\n"
]
}
],
"source": [
"sceneDict = {'tilt': 0, 'azimuth': 180, 'pitch': 5,'hub_height':1.5, 'nMods':5, 'nRows': 2}\n",
"trackerdict = demo.set1axis(metdata=metdata, cumulativesky=True, limit_angle=15, backtrack=False)\n",
"trackerdict = demo.genCumSky1axis()\n",
"trackerdict = demo.makeScene1axis(trackerdict, module = mymodule, sceneDict = sceneDict)\n",
"trackerdict = demo.makeOct1axis()\n",
"trackerdict = demo.analysis1axis(modWanted = [2,4], sensorsy=[2,3])\n",
"trackerdict = demo.analysis1axisground(sensorsground=10)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "d6340420",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Compiled results:\n",
"\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" rowNum | \n",
" modNum | \n",
" sceneNum | \n",
" BGG | \n",
" Gfront_mean | \n",
" Grear_mean | \n",
" POA_eff | \n",
" Wm2Front | \n",
" Wm2Back | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 1 | \n",
" 2 | \n",
" 0 | \n",
" 11.360663 | \n",
" 1.655209e+06 | \n",
" 208936.319433 | \n",
" [1845370.4100300001, 1840857.22746, 1843526.64... | \n",
" [1658321.0965, 1652096.3821999999, nan, nan, n... | \n",
" [211290.74520000003, 206276.09790000002, 20924... | \n",
"
\n",
" \n",
" | 1 | \n",
" 1 | \n",
" 3 | \n",
" 0 | \n",
" NaN | \n",
" 1.125122e+06 | \n",
" NaN | \n",
" [0.0, 0.0, 0.0] | \n",
" [632528.9293000001, 704530.8141, 871543.067099... | \n",
" [nan, nan, nan] | \n",
"
\n",
" \n",
" | 2 | \n",
" 1 | \n",
" 4 | \n",
" 0 | \n",
" 10.280712 | \n",
" 1.671282e+06 | \n",
" 190910.812600 | \n",
" [1845953.2714499997, 1839710.38887, 1843642.7352] | \n",
" [1671845.97, 1670718.8309999998, nan, nan, nan... | \n",
" [194078.7455, 187142.2093, 191511.48300000004] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" rowNum modNum sceneNum BGG Gfront_mean Grear_mean \\\n",
"0 1 2 0 11.360663 1.655209e+06 208936.319433 \n",
"1 1 3 0 NaN 1.125122e+06 NaN \n",
"2 1 4 0 10.280712 1.671282e+06 190910.812600 \n",
"\n",
" POA_eff \\\n",
"0 [1845370.4100300001, 1840857.22746, 1843526.64... \n",
"1 [0.0, 0.0, 0.0] \n",
"2 [1845953.2714499997, 1839710.38887, 1843642.7352] \n",
"\n",
" Wm2Front \\\n",
"0 [1658321.0965, 1652096.3821999999, nan, nan, n... \n",
"1 [632528.9293000001, 704530.8141, 871543.067099... \n",
"2 [1671845.97, 1670718.8309999998, nan, nan, nan... \n",
"\n",
" Wm2Back \n",
"0 [211290.74520000003, 206276.09790000002, 20924... \n",
"1 [nan, nan, nan] \n",
"2 [194078.7455, 187142.2093, 191511.48300000004] "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"results = demo.calculatePerformance1axis() # saves to demo.compiledResults and results/Cumulative_Results.csv\n",
"print('\\nCompiled results:\\n')\n",
"display(demo.compiledResults)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "5d891480",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" rowNum | \n",
" modNum | \n",
" sceneNum | \n",
" BGG | \n",
" Gfront_mean | \n",
" Grear_mean | \n",
" POA_eff | \n",
" Wm2Front | \n",
" Wm2Back | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 1 | \n",
" 2 | \n",
" 0 | \n",
" 11.361 | \n",
" 1655208.739 | \n",
" 208936.319 | \n",
" [1845370.4100300001, 1840857.22746, 1843526.64... | \n",
" [1658321.0965, 1652096.3821999999, nan, nan, n... | \n",
" [211290.74520000003, 206276.09790000002, 20924... | \n",
"
\n",
" \n",
" | 1 | \n",
" 1 | \n",
" 3 | \n",
" 0 | \n",
" NaN | \n",
" 1125121.777 | \n",
" NaN | \n",
" [0.0, 0.0, 0.0] | \n",
" [632528.9293000001, 704530.8141, 871543.067099... | \n",
" [nan, nan, nan] | \n",
"
\n",
" \n",
" | 2 | \n",
" 1 | \n",
" 4 | \n",
" 0 | \n",
" 10.281 | \n",
" 1671282.400 | \n",
" 190910.813 | \n",
" [1845953.2714499997, 1839710.38887, 1843642.7352] | \n",
" [1671845.97, 1670718.8309999998, nan, nan, nan... | \n",
" [194078.7455, 187142.2093, 191511.48300000004] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" rowNum modNum sceneNum BGG Gfront_mean Grear_mean \\\n",
"0 1 2 0 11.361 1655208.739 208936.319 \n",
"1 1 3 0 NaN 1125121.777 NaN \n",
"2 1 4 0 10.281 1671282.400 190910.813 \n",
"\n",
" POA_eff \\\n",
"0 [1845370.4100300001, 1840857.22746, 1843526.64... \n",
"1 [0.0, 0.0, 0.0] \n",
"2 [1845953.2714499997, 1839710.38887, 1843642.7352] \n",
"\n",
" Wm2Front \\\n",
"0 [1658321.0965, 1652096.3821999999, nan, nan, n... \n",
"1 [632528.9293000001, 704530.8141, 871543.067099... \n",
"2 [1671845.97, 1670718.8309999998, nan, nan, nan... \n",
"\n",
" Wm2Back \n",
"0 [211290.74520000003, 206276.09790000002, 20924... \n",
"1 [nan, nan, nan] \n",
"2 [194078.7455, 187142.2093, 191511.48300000004] "
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Results are also automatically saved in \\results\\Cumulative_Results.csv\n",
"pd.read_csv(os.path.join('results','Cumulative_Results.csv'))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0ab59c71",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}